KBEngine 技术概览
开源游戏服务端引擎
http://kbengine.org
󰚳󲚲
KBEngine 󰐾󰚳󲛹
󱃡Entity
Entity󱎵󲵋
Entity󰕩󲸙
Cell 󱸮󳏷
󰐾󲣯󱲟󱰥
󰐾󲤴󲤆
󰐾󱎵profiling󰩼󲤆
󱡝󱠑
KBEngine 󰐾󰚳󲛹
KBEngine 󰐾󰓧󰒵
Client Client
Client
Switch Fabric
Internet
Switch Fabric
Loginapp Loginapp Baseapp Baseapp
Baseapp
Cellapp Cellapp Cellapp BaseappMgr
CellappMgr
DBMgr
Database
Cellapp Cellapp
同时每台硬件机器需要运行守护进程machine
Loginapp󲴌󱜼
󱠠󱎵󱡝󲴏󰃖󰷪
󱎵󱠠
󲵋󰌧
󱉙󳇖(󳊰󱎵󳇖)
󱉙 / 󱔲
󱉙Loginapps󲩐󲲮󲖒
DNS󲲟󰩲󲤴
Baseapp󲴌󱜼
󱠠󲵋󱎵󰷪
󱠠Cellapp󲵋󱎵
󱠠󱎵󲴏󰃖󲖒Baseapp󳌥
󱉙󱄷󰧒󰐺󱞫󳌥󱲟󱎵Entity
󲕽
󱣒󱄷
󱣒󱄷
󰤀Baseapp󰌧󱑱Baseapp󳉊󱎵
󲜃󱾣
󲵋CPU / 󰕩 󱄷Baseapp
Base Entity()
Baseapp󰐺󱛾
Base
Proxy
Base
󲵋󱎵󰭩Entity
: 󰊡󰂟󲻽󱎵NPC, 󲕽
Proxy
󱠠󲴏󰃖
C++󱰘󱼛KBEngine.Base
󰾪󰢻󱎵Base
Baseapp 󳉊󱄷
entity󱎵Baseapps
Baseapp Baseapp Baseapp
Baseapp
󱼛󱎵Base 
Baseapp󱎵base
󱎵
Baseapp 󳉊󱄷
Baseapp crash󱉙
Baseapp Baseapp Baseapp
󱼛󱎵Base 
Baseapp󱎵base
󱎵
Baseapp 󳉊󱄷
󰶯󳏯󱉐󲵐󰂓󱎵Baseapp
Baseapp Baseapp Baseapp
󱼛󱎵Base 
Baseapp󱎵base
󱎵
Baseapp 󳉊󱄷
Crash󱎵Baseapp󲴏󰃖󱎵󱠠󲗜󰋞󲴏󰃖
󰐺󱎵󰊡󰂟󲸮󲗜
󲻾󰋡󲴏󰃖󱰘󱰞󰒖󱎵Entity 󲴏󰃖 (󰓍󰧒󰐺timeout󱎵󲤎)
Baseapp 󱎵󱣒󱄷(BaseappMgr)
󲩐󲩔󱣒󱄷Baseapp󳌥󱎵󲩐󲲮󲖒
󱐂󲛷󰐺󱎵Baseapp󱃡Baseapp󳌥󱎵
󳉊
󲚲󱉙󱃚󱎬󲹾Entity
󰐾󱳕󱯵󰐺BaseappMgr
Cellapp󲴌󱜼
󱞫󳌥󱲟󰊡󰂟󱎵󱄷
󱄷󱃚󱎵Space (󱞫󳌥󳌥󰎠)
󱄷Space󱎵Entity
󱄷Space󱎵 (Cell)
CellappSpace󱎵Cell󰐺(󲵋 󲴌󱜼󱉙CPU/
󰕩Cell󰧒󰐺)
Celapp󰐺󱸮󱄷Space
󲵋CPU/󰕩󱄷Cellapp
Cells & Spaces
󱐟󰉠󰀲SpaceCell󱉢Cellapps
󲩐󲲮󰢕󰑝󳖦󱊖
Spaces󲵋󲳸Cells󰒖󱃡󲖒󲩐󲲮
󰤀Space󱼤󰐺Cell
󰤀Cell󱄷Space󱎵
Cell󱎵󲳪󱉽󰕪󰂟Cell󱎵󲩐󲲮󱴽󱜬
Cells󱠠󱎵󰭩󳞽
Cell1
Cell2
Cell3
Cell4 Cell5
Cell6
Space󲗜Cell
Cellapp󲚲󲩐󲲮󱎵󰋪
󱣒󱄷󱎵Entity󱎵󰊡󲼀
Entity󱎵󲵋󱎵󳗂󱂸
󱉙󲤴󱉙󱎵󰋪󰨆
󱨬󱰐󱼛󰐥󰋡󱎵
Entity󱎵󳏷
Entity 󱹋󰑝
Entity󱎵󰊡󰂟
EntityCell
󰤀space󱼤󰐺Entity
󲵋󱡝Entity󰍠SpaceEntity󱉙󲣚󱉙󰇾󰃘Space
CellApp󱎵󰤀󱃚Entity󲸮󰐺Witness󲦒
Witness󱐂󲛷󱎵Entity󱉐󱎵󰪹󰢖󱠠
Entity󱎵󲫔󲀴(AOI)󱱫󱐲󰍠500M
󰍠󱼛󱎵󲪇󱩑
EntityCell (󰑝󳖦󲬙Cell󰑛󱃡)
Entity󱞰󲪻Cell󲳪󱉽󰍠󰌑󱱎󱎵
󱠠󲛺(󱞰󲪻󲳪󱉽󱎵󱉐)
󰤀Cell󱰥󱑱list󰉯󱑱󲳪󱉽󰧰󱎵
Entity
Ghost entities
500m󲹾󱲟
󱡺AOI
Cell1 Cell2
500m radius
Real Entity
Ghost Entity
500m boundary
region
500m boundary
region
Entity: RealGhost
Real Entity󰍠󰑴󱎵Entity
Ghost Entity󰍠󲷬󲴂󱎵Cell󱎵󱎵Entity󱎵
󲸙󰊡󰂟󱎵󰀨󲩎
Cell1 Cell2
500m boundary
region
500m boundary
region
Real Entity
Ghost Entity
Ghost Entity
󲜔󲬙󲪻Cell󲳪󱉽󱎵Entity󱎵󳌟󳗉
󰋪󰨆󲤴󱉙
󲲝󱰊Real Entity

󰍠real only󱎵, : 󰥩󲴍ghost
󰓍󱠠󰍠󲛲󱎵󲷔󲤖󳖬󰍠ghost󱎵,
󱎵󰢗󱡺󱯘󱜡
Ghost󰍠󲤬󱎵
󲚲󰐥󰉪󱸮󲵋󲳸󰋪󰨆󲤴󱉙󰒖󰐥󰋡󱎵Real Entity
Entity󱎵󰊡󰂟󰐥󰋡
󱠠󱃡LOD󲵐󰭣󰔄
Cellapp󱃡LOD:
󱎵󰪹󱵈
󰤀Entity󱎵CPU󰪹󱵈
LODCellapp󱎵󱉙󱦬󱠠󱎵󱉙
󱯷󱾳󱜼󰍠󱐩󱃚entity󱎵󲬎󱛬󱎵
󱠠Entity󰋪󰨆󱃡LOD
Entity󱃡LOD󲶰󲚲󱎵󲵋
󱠠
󱎵󲕱󲼀 (󲴍󱎵󲬎󱛬(󱎵Entity)󰒖󲤥󰍠󲛲󱎵)
Cellapp󱣒󱄷(CellappMgr)
CellappMgr󱔖󲶄:
󰐺󱎵Cellapp (󱎵󲩐󲲮)
󰐺󱎵Cell󲳪󱉽
󰐺Space
󱣒󱄷Cellapp󱎵󲩐󲲮󲖒
󲣺Cellapp󱎵Cell󲳪󱉽󲤖󲻽
󰋡󱎵Entity󰢔󱖟󱎵Cell
󰐾󱳕󱯵CellappMgr
󰊡󰂟󱣒󱄷(DBMgr)
󱣒󱄷Entity󰊡󰂟󱎵󰊡󰂟
󲩐󲩔󰊡󰂟󱎵󰐾󳌥󱎵Entity󱎵󲵋
󰉠󰀲󱎵󰊡󰂟󱦬:
MySQL
MongoDB
Redis
󱼛
󰐱󱀝󱟼󱎵󰑫󲴁󲕽
Entity
󰖔
Baseapp󳌥󲲟󰩲󲤴󱄷
BaseappCellapp󲚲Entity󱎵Cell󲸙󱎵󰊡󰂟󰌧󲲝󱰊DBMgr
KBEngine󱎵󰑫Daemon(machine)
Daemon󱉙󱐂󲛷󰐾󲴌󱜼
󰤀󰐾󰑫󰐺machine
/󰢓󰐾󲴌󱜼
󲵋󱔖󰐾󱳕󱯵󲴌󱜼󱎵󰩬󰿧
󱐂󲛷󰑫󱎵󱉙󰿧
CPU /  / 
KBEngine󰐾󱠠󲵋󱎵󰇾
Baseapp2Cellapp
󰭩
󰌚Profile󱰀Profile
󲣩󰉯󱀝󱟼󱎵󰑫󱎵󲴌󱜼:
DBMgr
󱦬󲴌󱜼
󱎬󲳸󱜼
󱠠󱎬󲤨󰥳
󰀸IP/󱠠
Loginapp󰉧󱎬󲤨󰥳
󲜔󲤨󰥳󰪹(󱠠󲴺󰀚󲵋󲣠󲷔󰐾󱠠󲴌󲕽󲜔)
Loginapp󲲝󱎬󰪹DBMgr
DBMgr󳞽󲣲󱉙/󱔲
󰔖󲤓󰊡󰂟
󲲝󲤨󰥳BaseappMgr
BaseappMgr󲴲Player Entity󱎵󰪹󲩐󲲮󰐱󱎵Baseapp
Baseapp󰋡󱎵Proxy
󱸮󰋡󱎵Cell Entity
Proxy󱎵TCP󱠠󲗜󲴅󱰊󱠠
󲵅BaseappMgr, DBMgr, Loginapp
󱡝󱠑
󱃡Entity
󰭩󳖪󱐟󲩵
KBEngine󰇿󳰉󲣕󲩵
󰓍󱉙󰧒󰐺󲣯󱲟󱃠󲼀󰀸󰇿󳰉󲣕󲤆󲤬󰇿󰕪󱐟assets
󳰉󲣕󱎵󲩵
󲩵󱎵󰚳󱦬Unity3D󱎵Assets󲳸󰊸󱜡󱰄󰒵󲗜

󱎵󳖪󱐟󰍠󱎵󲩵
󲚲󰇿󰌧󲤬󱎵󳖪󱐟󲩵󳖬󱃠󲼀
*.py
󱼛󱦬󱹋󰑝
󲩵󰊸󱰄󰒵
󰐺󱎵entity
Entity󱎵󰋪󰨆
(XML)
󱃡
󰋪󰨆 (Python)
<assets>
scripts
entities.xml
base
cell
client
entity_defs
<entity>.py
Baseapp󱹋󰑝
<entity>.py
Cellapp󱹋󰑝
<entity>.py
Client󱹋󰑝(Python󲜔󰓁󱎵󱉐󱃠
󰐺󰉹Unity3D󱡺󰄃󱃠󳐱󲚲󰢕󱃡)
<entity>.def
󰊸
common
*.py
󱉙󱎵script
Cell, Base, Client 󱐩
󳌥󱉙󱎵󱃡󰊡
server_common
*.py
󱉙󱎵script
Cell, Base 󱐩󳌥
󱉙󱎵󱃡󰊡
user_type
res
󲩵󰊸󱰄󰒵
<assets>
scripts
data
db
bots
server
spaces
kbengine.xml
󰐾󱠠󲹾󱲟󰊸
󱞫󳌥󱎵󲩵󰯁󰊡󰂟󰄁󰐾󱠠󱽛󱎵󱗡󰇏
res
󰐾󱠠󲵬󲳂󰊡󰂟󰊸󱢇󲖙󰊡󰂟
󰊡󰂟
󰑫󰩼󲤆󲎋󰀐󱠠󱹋󰑝, 󱢱
scripts/client󱎵󱹋󰑝󱃡
Entity󱎵󱃡
󰤀Entity󳖬:
entities.xml󰊸󱎵󲖙󲻽
󳖬󰐺<Entity_name>.def󰊸
󳖬󰐺<Entity_name>.py󰊸
󰤀Entity:
󰐺󰐱3󲸙󱎵󱃡 (Client/Cell/Base)
󱉙common󲬠󱎵󱎵󱹋󰑝
Client / Server󱎵󰊸󳖬󲹾
󰄃󱃠󰄃󰕪󰂟󲣟MD5󲣲󲣟󰍠󰐱󰋡󱎵󲣟󲹾
󰌧󰐾󱠠󱲂󱰍󰑝
󱎵Entity
Base Entity
Real Entity
Ghost Entity
Player Entity
Client Entity
Baseapp
A
B
Baseapp
C
Client
A
Client
B
Client
C
Cellapp1-cell1
A
B
Cellapp2-cell2
C
Cellapp3-cell3
A
B
C
A
B
C
Space1 - Cell1 Space1 - Cell2
Space1 - Cell3
A
B
C
A
B
B
C
A
C
A
B
space
󱎵Entity
CellApp1,CellApp2CellApp3󲸮󱼛󰐺
Space1󱎵Cell
Entity A,BC󲸮Space1
Cellapp1
A
B
Cellapp2
C
Cellapp3
A
B
C
A
B
C
Space1 - Cell1 Space1 - Cell2
Space1 - Cell3
A
B
C
A
B
space
󱎵Entity-Cellapp1󰒖󱐼
Space1󱎵CellApp1󱎵Cell
AB󰍠Real Entity
C󰍠CellApp2ghost󰒖󱎵ghost Entity
Cellapp1
A
B
Cellapp2
C
Cellapp3
A
B
C
A
B
C
Space1 - Cell1 Space1 - Cell2
Space1 - Cell3
A
B
C
A
B
space
󱎵Entity-Cellapp2󰒖󱐼
Space1󱎵CellApp2󱎵Cell
C󰍠Real Entity
AB󰍠CellApp1ghost󰒖󱎵ghost Entity
Cellapp1
A
B
Cellapp2
C
Cellapp3
A
B
C
A
B
C
Space1 - Cell1 Space1 - Cell2
Space1 - Cell3
A
B
C
A
B
space
󱎵Entity-Cellapp3󰒖󱐼
Space1󱎵CellApp3󱎵Cell
AB󰍠CellApp1ghost󰒖󱎵ghost Entity
C󰍠CellApp2ghost󰒖󱎵ghost Entity
Cellapp1
A
B
Cellapp2
C
Cellapp3
A
B
C
A
B
C
Space1 - Cell1 Space1 - Cell2
Space1 - Cell3
A
B
C
A
B
space
󱢱󱎵Entity
Account.def:
------------
<root>
<Properties>
</Properties>
<ClientMethods>
</ClientMethods>
<BaseMethods>
</BaseMethods>
<CellMethods>
</CellMethods>
</root>
Entity󱎵󱰘
Entity󰊸󰉠󰀲󱰘
<assets>/scripts/entity_defs/interfaces
󱛾󱰘󰑫:
<Parent>
󱰘󰐺󱎵󲚰
 / 󰋪󰨆
Volatile 
LOD 󱯘
󱢱󱯘󱎵󱰘
<Implements>
󱰘󰋪󰨆
󱯘󱎵󱰘
Avatar󱎵
<root>
<Volatile>
<position/>
<!--<position> 0 </position> Don't update-->
<yaw/>
<!--<pitch> 20 </pitch>-->
<pitch/>
<roll/>
</Volatile>
<Implements>
<Interface> GameObject </Interface>
<Interface> State </Interface>
</Implements>
<Properties>
<roleType>
<Type> UINT8 </Type>
<Flags> BASE </Flags>
<Persistent> true </Persistent>
</roleType>
</Properties>
<BaseMethods>
<createCell>
<Arg> MAILBOX </Arg>
</createCell>
</BaseMethods>
<CellMethods>
<jump>
<Exposed/>
</jump>
</CellMethods>
<ClientMethods>
<onJump/>
</ClientMethods>
</root>
Entity󱎵
󱦬
󰐺󲤞󲜱󰕨
󱲂󱰍󲳄/󰊡󰂟󰔸
󱱫󱐲
󱉢󱦬
󰊸󲻽󲚷󱐇
󰇞󱎵󰔸
Detail Level
Volatile 
󰍠󰊡󰂟
Entity
Cell󱎵
Entity󰊡󰂟󲗜󳗂󱭲󲣰󳌟
󲬙󲪻Cell Boundary󰌧󰊡󰂟󲗜󰋡󱎵Cell
󰊡󰂟Base
󰊡󰂟󰉪󰌧󲵋󱔖󱠠:
󱎵󰉪
entity󲴌󱃚󱎵AOI󰌧
Base󱎵
󰐥󰑳/󲣰󳌟󲲴
󰊡󰂟󰉪󰌧󲵋󱔖󱠠
Entity
Client󱎵
󲣰󳌟󲸙󱎵server
Cell󰒖
Cell󰉪󲜗set_<property>()
:
def set_HP( self, old ):
if self.HP == 0 and old > 0:
self.doDeath()
Entity󰊡󰂟󱦬
󱢱󱦬
INT8 / UINT8
FLOAT32 / FLOAT64
STRING
VECTOR3
󱦬
ARRAY
TUPLE
Entity󰊡󰂟󱦬
<root>
<Properties>
<name>
<Type>
STRING </Type>
</name>
<items>
<Type> ARRAY
<of> UINT8 </of>
</Type>
</items>
</Properties>
...
</root>
Entity󰊡󰂟󱦬
󰑳󱦬
FIXED_DICT
Dictionary󱎵󲦒
󱎵key󳏷
PYTHON
󰤅FIXED_DICT󰉹
󰉠󰀲Python󰊡󰂟󱦬

(󲤬󱠠󰒖󱎵󰊡󰂟󰒖Python󲦒)
󱉙Python󱎵pickle󰝒
Unity3D󱡺󰄃󱃠󲤖󲤖󱦬󲳄󱠠
(C#󰌑󰨆󲜔󰓁)
Entity󰊡󰂟󱦬
<root>
<Properties>
<CharacterInfos>
<Type> FIXED_DICT
<Properties>
<name>
<Type> STRING </Type>
</name>
<level>
<Type> UINT8 </Type>
</ level >
</Properties>
</Type>
</CharacterInfos>
</Properties>
...
</root>
󱦬
󲻾󱉙󱎵󱦬󱼛
<assets>/scripts/entity_defs/alias.xml
<SKILLID> INT32 </SKILLID>
<QUESTID> INT32 </QUESTID>
<EXAMPLES> FIXED_DICT
<Properties>
<k1>
<Persistent> false </Persistent>
<Type> INT64 </Type>
</k1>
<k2>
<Type> INT64 </Type>
</k2>
</Properties>
</EXAMPLES>
Entity󱎵
<root>
<Properties>
<name>
<Type> STRING </Type>
<Flags> ?? </Flags>
</name>
</Properties>
...
</root>
Entity󱎵
BASE
OWN_CLIENT
Ghost Base Cell
Own client Other clients
CELL_PRIVATE
CELL_PUBLIC
OTHER_CLIENTS
CELL_PUBLIC_AND_OWN
ALL_CLIENTS
BASE_AND_CLIENT
Entity󱎵 - BASE
Base
󰐺Base󲣰󳌟
Baseapp2Baseapp3󰌑󰨆󲣰󳌟Baseapp1󱯓󱾣󱎵BASE
BASE󱎵󰉪󲗜󰇞
.def󰊸󲻽󱑱󲗜󰑐󱎵Baseapp
󰊡󰂟󲻽
:
󲩗Entity󲣡󱃚󰡒󲴌󰭩󲴺󰀚󱎵󲜃󱾣DBID
󱣒󱄷󲣡󱎵󲖙
Baseapp1
Baseapp2
󲣰󳌟󲤖󰄀󲴡󱎵󱎵
󲣰󳌟󲤖󰄀󲴡󱎵󱎵
󰄀󲴡󱎵󲣰󳌟
Baseapp3
Entity󱎵 - BASE_AND_CLIENT
Base
Base󱼛󱎵󱠠󲣰󳌟
Baseapp2Baseapp3󰌑󰨆󲣰󳌟Baseapp1󱯓󱾣󱎵BASE_AND_CLIENT
󲤖󱦬󱎵󱎵󰉪󲗜󱎵󱼛󱎵󱠠󱎵entity
󰐺󱹋󰑝󱎵󲤴(set_<property_name>())󰊡󲗜󲤴󱉙
:
󲩗Entity󲣡󱃚󰡒󲴌󰭩󲴺󰀚󱎵󲜃󱾣DBID󱠠󳐱󲚲󲴺󲜃󱾣󲴌󲕽󲖙
󱃡
󱉙
Baseapp1 Baseapp2
󲣰󳌟󲤖󰄀󲴡󱎵󱎵
󲣰󳌟󲤖󰄀󲴡󱎵󱎵
󰄀󲴡󱎵󲣰󳌟
Baseapp3
Client
Entity󱎵 CELL_PRIVATE
Real Entity󰐺Real Entity󱸮󲣰󳌟
Cellapp2Cellapp3󰌑󰨆󲣰󳌟Cellapp1󱯓󱾣󱎵CELL_PRIVATE
.def󰊸󲻽󱑱Cell󱎵EntityCell󰂓Cell󰌧󲴊󱦬
󱎵󲗜󳏀󱑱󱜬󰘾󰋡󱎵Cell󲴊󱦬󱎵󲗜󰑐󱎵Base
Entity
:
NPC AI 󰨆
Player󱎵󰭩play󱎵󰍠player󲤖󱐼
Cellapp1 Cellapp2
󲣰󳌟󲤖󰄀󲴡󱎵󱎵
󲣰󳌟󲤖󰄀󲴡󱎵󱎵
󰄀󲴡󱎵󲣰󳌟
Cellapp3
Client1
Baseapp2
Baseapp1
Baseapp3
Client2
Entity󱎵 CELL_PUBLIC
Real Entity
󱎵Real Entity󱎵ghost Entity󲸮󲣰󳌟
󲤖󱦬󱎵󱎵󰉪󲗜󱎵ghost Entityghost Entity󲴊󱦬
󰍠󲤬󱎵
:
󰾚󱎵󰏥󱯘
NPC󱎵󱡺󱯘
Cellapp1-space1 Cellapp2-space1
󲣰󳌟󲤖󰄀󲴡󱎵󱎵
󲣰󳌟󲤖󰄀󲴡󱎵󱎵
󰄀󲴡󱎵󲣰󳌟
Cellapp3-space1
Client1 Client2
Baseapp2
Baseapp1
Baseapp3
space
󲸮󱯓󱾣󳍵󲴂
Entity󱎵 CELL_PUBLIC_AND_OWN
Real Entity
󱎵Real Entity󱎵ghost Entity󲸮󲣰󳌟
󲤖󱦬󱎵󱎵󰉪󲗜󱎵ghost Entityghost Entity󲴊󱦬
󰍠󲤬󱎵
󲤖󱦬󱎵󱎵󰉪󲗜󱎵󱼛󱎵󱠠󱎵entity󰐺
󱹋󰑝󱎵󲤴(set_<property_name>())󰊡󲗜󲤴󱉙
:
Avatar󱎵󰉽󲖙󰐾󱠠AI󰗱󰔖Avatar󰉽󲖙󰋈󱠠󰍯󱙫󰉽
󲖙󱎵󰃃󱴽󱠠󳐱󲚲󱐼Avatar󱎵󲖙
Cellapp1-space1 Cellapp2-space1
2
1
󲣰󳌟󲤖󰄀󲴡󱎵󱎵
󲣰󳌟󲤖󰄀󲴡󱎵󱎵
󰄀󲴡󱎵󲣰󳌟
Cellapp3-space1
Client1
1
Client2
2
Baseapp2
Baseapp1
1
2
Baseapp3
space
󲸮󱯓󱾣󳍵󲴂
Entity󱎵 ALL_CLIENTS
Real Entity
󱎵Real Entity󱎵ghost Entity󲸮󲣰󳌟
󲤖󱦬󱎵󱎵󰉪󲗜󱎵ghost Entityghost Entity󲴊󱦬󰍠󲤬󱎵
󲤖󱦬󱎵󱎵󰉪󲗜󱎵󱼛󱎵󱠠󱎵Entity󰐺󱹋󰑝󱎵󲤴
(set_<property_name>())󰊡󲗜󲤴󱉙
󰓍󱎵󱃚󱎵AOI󲀴󰐺󲴊󳏧󱎵Entity󲷔󲴊󱎵󱎵󰉪󲗜󲴊󱃚
󱎵󱠠󱎵󲤖Entity󰐺󱹋󰑝󱎵󲤴(set_<property_name>())󰊡󲗜󲤴󱉙
:
󱜡
󲕱󲼀󱡺󱯘
Cellapp1-space1 Cellapp2-space1
2
1
󲣰󳌟󲤖󰄀󲴡󱎵󱎵
󲣰󳌟󲤖󰄀󲴡󱎵󱎵
󰄀󲴡󱎵󲣰󳌟
Cellapp3-space1
Client1
1
Client2
2
Baseapp2
Baseapp1
1
2
Baseapp3
space
󲸮󱯓󱾣󳍵󲴂
Entity󱎵 OWN_CLIENT
Real Entity
󱎵Real Entity󱼛󱎵󱠠󲣰󳌟
󲤖󱦬󱎵󱎵󰉪󲗜󱎵󱼛󱎵󱠠󱎵Entity󰐺󱹋󰑝󱎵󲤴
(set_<property_name>())󰊡󲗜󲤴󱉙
:
󲜃󱾣󱎵󰊀󰂨󲼀󰎫󲤖󱉙󲣒󱣈󲜃󱾣󰐱󱯹󱎵󱸮󳐱󲚲󲣰󳌟󲤖󱴽󱼛󱎵󱠠󳐱󲚲
󲜃󱾣󳒓󰒰󰍯󱙫󲴊󱉙󲹾󰷪
󲜃󱾣󱎵󱰀󳞽
Cellapp1-space1 Cellapp2-space1
2
1
󲣰󳌟󲤖󰄀󲴡󱎵󱎵
󲣰󳌟󲤖󰄀󲴡󱎵󱎵
󰄀󲴡󱎵󲣰󳌟
Cellapp3-space1
Client1
1
Client2
2
Baseapp2
Baseapp1
1
2
Baseapp3
space
󲸮󱯓󱾣󳍵󲴂
Entity󱎵 OTHER_CLIENTS
Real Entity
󱎵Real Entity󱎵ghost Entityde 󱠠󲸮󲣰󳌟
󲤖󱦬󱎵󱎵󰉪󲗜󱎵ghost Entityghost Entity󲴊󱦬󰍠󲤬󱎵
󰓍󱎵󱃚󱎵AOI󲀴󰐺󲴊󳏧󱎵Entity󲷔󲴊󱎵󱎵󰉪󲗜󲴊󱃚
󱎵󱠠󱎵󲤖Entity󰐺󱹋󰑝󱎵󲤴(set_<property_name>())󰊡󲗜󲤴󱉙
:
󱎵󱉽󰾚󱎵󰿧 (: 󳌙, 󰀺󳇟, )
󱠠󰑝󱔖󰔁󰿧󰍠󰿧󰇞󱰊󱠠
Cellapp1-space1 Cellapp2-space1
2
1
󲣰󳌟󲤖󰄀󲴡󱎵󱎵
󲣰󳌟󲤖󰄀󲴡󱎵󱎵
󰄀󲴡󱎵󲣰󳌟
Cellapp3-space1
Client1
1
Client2
2
Baseapp2
Baseapp1
1
2
Baseapp3
space
󲸮󱯓󱾣󳍵󲴂
Volatile
󱎵󲣟
󰐱󲴂󰐥󰋡󱎵󰊡󰂟󰐺󲫔
Position (x,y,z)
Yaw, Pitch, Roll
Detail Level(󰑛󱃡)
󰐥󰋡󱠠
󱉙󱐼󲛲󱎵
󱾳󱐲󰑫
󰓍󳐱󲚲󱉙󰍠󳖬󱉙
󱉙<DetailLevel>󰀸
Detail levels  <LodLevels>
Detail Level(󰑛󱃡)
<root>
<LoDLevels>
<level> 20 <label> NEAR </label> </level>
<level> 100 <label> MEDIUM </label> </level>
<level> 250 <label> FAR </label> </level>
</
LodLevels>
<Properties>
<name>
<Type> STRING </Type>
<Flags> ALL_CLIENTS </Flags>
<DetailLevel> NEAR </DetailLevel>
</name>
</Properties>
...
</root>
Entity󱎵󰊡󰂟
entity󱎵󰊡󰂟󱸮󳐱󲚲󰊡󰂟󲴊󰕨󰍠󰐾
󲻾󲴊󰊡󰂟󲴉󰐺󰉹

Entity󲗜󰊡󰂟󲻽
󱼛󰊡󰂟󲻽self.databaseID
<root>
<Properties>
<name>
<Type> STRING </Type>
<Flags> ALL_CLIENTS </Flags>
<Persistent> true </Persistent>
</name>
</Properties>
...
</root>
Entity󰋪󰨆

Client / Cell / Base
󳖬󰊡
Base / Cell󰋪󰨆󲗜󰏥󳑣󱰊Client󱠠󱉙
Client󰋪󰨆󰀸󰐱󱎵󲤴󱉙󲀴
󲚲󲴍󱜼󱎵󲤴󱉙(󲬙Client / Cell / Base)󳖬
󰊸(.def)󲻽
Entity󰋪󰨆
<root>
<Properties>
...
</Properties>
<ClientMethods>
...
</ClientMethods>
<BaseMethods>
<addToFriendsList>
<!-- Entity ID -->
<Arg> INT32 </Arg>
<!-- Expose to client -->
<Exposed />
<addToFriendsList>
</BaseMethods>
<CellMethods>
...
</CellMethods>
</root>
Entity󰏥󳑣󰋪󰨆󲣩Client󲤴󱉙
󰍠󰐺󱎵server󰋪󰨆󲸮󲗜󰏥󳑣󱎵
󳐱󲚲<Exposed />󰌿
󰏥󳑣󱎵Cell󰋪󰨆
󱼛󱎵󰃖󰉧󲤴󱉙󰋪󱎵EntityID
󲵋󲚲󰗱󰔖󰍠
self.id == callerID
󰏥󳑣󱎵Base󰋪󰨆
󰐺󱼛󱎵Client󲤴󱉙
Entity󰋪󰨆(󰑝󳖦󰑛󱃡)
Client󰋪󰨆LoD
󱠠󱎵󱉙
󲴂󲬎󱛬󱉐󲛷󱎵󰉹󰓍
󰇞Client󰪹󰌧󰐺󱉙
<root>
...
<ClientMethods>
...
<smile>
<DetailDistance> 30 </DetailDistance>
</smile>
...
</ClientMethods>
...
</root>
Entity󰋪󰨆
Entity󰕪󰂟󳐱󲚲Cell/Base/Client󱎵

󰓍󰧒󰐺Entity󱎵󳐱󲚲󲷔
󲴊󳐱󲚲󲤖Entity󱎵Python󱹋󰑝
Entity󱎵
Base Cell Client
SpawnPoint
󱎵󱉐󰾚*
Player Entity
Server AI/NPC's
* 󰧒󰐺Base󲸙󱎵Entity󰍠󳉊󱎵
󱵻/
󱹋󰑝󱎵󰀸
󱸮󱎵󲩐󲲮󰉯BaseApp
󱸮󳐱󲚲󰊡󰂟󱎵Entity󱎵
󲶰󲳸󲤴󱉙writeToDB()
󲼀󰑳󱯘󱎵󰊡󰂟
: 󱰥󰊡󱯵
󰓍󱹋󰑝󱎵󲕽󰌧󳌥󲪶󲳸1game tick󲩐󳒓
󰐾󱎵󰉹󱂸
󱡝󱠑
Entity󱎵󲵋
Mailbox
󰀸󲴍󱜼󲴌󱜼󱎵Entity
: Entity󱎵Cell󲸙
󲴍󱜼󱎵󲤴󱉙󰊡󲴌󱜼󲤴󱉙󲴌󱜼
󱎵󰊡
: mb 󰍠Cell entity mailbox
mb.someMethod( a, b )
Real cell entity󱎵󲴌󱜼󱎵someMethod()󱎵󲤴󱉙
Intra-entity󲵋
: Cell󲸙Base󲸙
Inter-entity󲵋
: Entity A󱎵Cell󲸙Entity B󱎵Base󲸙
Mailbox
󱎵󱦬
Base
Cell
Client
󰢖󲬤󲲝
󰢖󲬤󲲝
󲵋󲳸basecell(xxx.base.cell.someMethod())
KBEngine󰋪󰨆󱸮󰃖󰉧󰾪󱎵󱦬󱎵
Mailbox
󱯷󱾳󲤨󱴴API󰊸󰖔
Mailbox
Entity󰐺mailbox󲼀
Client entity: self.cell, self.base (󱉙󱃚)
Base entity: self.cell
Proxy entity: self.cell, self.client
Cell entity:
self.base
self.ownClient
self.allClients
self.otherClients
Mailbox
Entity󲦒󲗜󰐺Mailbox󰊡󱎵
server󰋪󰨆󰌧Mailbox󲦒󲗜󱼛
:
Cell󰋪󰨆talkToMe()󰐺MAILBOX󰊡
Cell, EntityA󲤴󱉙:
entityB.talkToMe( self )
Entity A󱎵mailbox󲗜Entity B
def talkToMe( self, mailbox ):
mailbox.sendMsg(‏“hello”‏)
Entity A󱎵sendMsg()󲗜󲤴󱉙 “hello”󰊡
Mailbox
Base󱎵mailbox󰍠Entity󱎵󱉐󰑐󲸮󰐺󰉹󱎵
Base entity󱎵Baseapp󰥩󲴍󰉪
󱉙󳊰󱎵Entity󳌥󱎵󲵋
󰓍mailbox󳖬󱃡󰪹󲵋󱔖󱎵󰑫Entity
󳎕󰌧󲵋󱔖mailbox󰌑󰉹
Cell mailbox󱔞󱎵󰌧󳌥󰐺󰉹
Cell entity󱎵Cellapp󳏀󰌧󱸮󰉪
󲚲Cell MailBox 
󱟼󱉙󱟼󲻻󰉯
Mailbox
󱸮Client󲵃Mailbox󱸮󲵃Mailbox
Client
󱸮Client
󱴽󱉙Entity ID
Mailbox󱸮󲗜󰊡󰂟󲻽
Server󲻾IP󲗜󰉪
CellClient󱎵󲵋
Self󰍠Player A
PlayerBaseapp󳖬󰍠 Proxy
󲴊MailBox󱸮󲗜󲵃
󰪹󱉢Baseapp󲲝Client
self.ownClient.chat()
self.otherClients.chat()
self.allClients.chat()
self.clientEntity(entityX).chat()
Cellapp
Player A
Client A
Client B
Client C
Client A
Player A
Player A
Player A
entityX
Entity.ownClient 󰋪󰨆󲤴󱉙󱙫
self.ownClient.chat() 󳍶chat󰊡A󱠠󱎵entity A󲗜󲤴󱉙
󱎵󱠠󲣷A󱠠󰐺A.chat()󲗜󲤴󱉙
self.ownClient.chat()
Cellapp
Player A
Client A
Player A
󱼥 󲗜󲤴󱉙
Entity.ownClient 󰋪󰨆󲤴󱉙󱙫
Base Entity
Real Entity
Ghost Entity
Player Entity
Client Entity
Baseapp
C
Client
A
Client
B
Client
C
Cellapp1-cell1
A
B
Cellapp2-cell2
C
Cellapp3-cell3
A
B
C
A
B
C
Space1 - Cell1 Space1 - Cell2
Space1 - Cell3
A
B
C
A
B
B
C
A
C
A
B
space
Baseapp
A
B
cell󲤴󱉙
A.ownClient.chat()
󱼥A.chat()󲗜󲤴󱉙
Entity.allClients 󰋪󰨆󲤴󱉙󱙫
self.allClients.chat() 󰐺󱐼A󱎵󱃚󱠠󱎵entity A󱎵chat()󰊡󲗜
󲤴󱉙
󰓍󱃚A󱎵spaceAAoI󲀴󲷔󲴊󱃚
󱎵󱠠󱸮󱐼A
󱼥 󲗜󲤴󱉙
self.allClients.chat()
Cellapp
Player A
Client A
Client B
Player A
Player A
Client C
Player A
Entity.allClients 󰋪󰨆󲤴󱉙󱙫
Base Entity
Real Entity
Ghost Entity
Player Entity
Client Entity
Baseapp
C
Client
A
Client
B
Client
C
Cellapp1-cell1
A
B
Cellapp2-cell2
C
Cellapp3-cell3
A
B
C
A
B
C
Space1 - Cell1 Space1 - Cell2
Space1 - Cell3
A
B
C
A
B
B
C
A
C
A
B
space
Baseapp
A
B
cell󲤴󱉙
A.allClients.chat()
󱠠A,BC
󱎵A.chat() 󲸮󲗜
󲤴󱉙
Entity.otherClients 󰋪󰨆󲤴󱉙󱙫
self.otherClients.chat()󰐺󱐼A󱎵󱃚󱠠󱎵Entity A󱎵chat()󰊡
󲗜󲤴󱉙A󱠠󰑝󲯜󳎕
󰓍󱃚A󱎵SpaceAAOI󲀴󲷔󲴊󱃚
󱎵󱠠󱸮󱐼A
󲵋󱉙󲤖󱃚󱠠󱟼󲛲󰉹󰓍󱎵󱉙otherClients󱎵󰋪
󲤖󰇞󱃚󱠠󲬤󲫴
󱼥 󲗜󲤴󱉙
Cellapp
Player A
self.clientEntity(entityX).chat()
Client A
entityX
Entity.otherClients 󰋪󰨆󲤴󱉙󱙫
Base Entity
Real Entity
Ghost Entity
Player Entity
Client Entity
Baseapp
C
Client
A
Client
B
Client
C
Cellapp1-cell1
A
B
Cellapp2-cell2
C
Cellapp3-cell3
A
B
C
A
B
C
Space1 - Cell1 Space1 - Cell2
Space1 - Cell3
A
B
C
A
B
B
C
A
C
A
B
space
Baseapp
A
B
cell󲤴󱉙
A.OtherClients.jum
p()
󱠠BC
󱎵A.jump () 󲸮󲗜󲤴
󱉙
󱡝󱠑
󰕩Entity󲸙
Baseapp󱎵Entity󱦬
Base
Python󱹋󰑝󱰘KBEngine.Base
󰉯󲼀󰑳󱎵󰊡󰂟
Cell entity󲬙󲪻Cell󲳪󱉽󱎵󰌧󱎵󱨬󱰐󱎵󲩐
󰍠󰃖󰉧󰋪󰨆󲤴󱉙󱎵󱎵Mailbox
Proxy
Python󱹋󰑝󱰘KBEngine.Proxy
KBEngine.Proxy󲸙󱰘KBEngine.Base
󰍠Client󲵋󱎵󱾳󰷪
Client󰕪󰂟󳐱󲚲󳍵󳎕Proxy
Baseapp󱎵Entity
KBEngine.Base󱰘󱎵Entity󱎵
id
󱎵Entity IDCell,Base,Client󱉙id
databaseID
Entity󰊡󰂟󲻽󱎵󰥩ID󰓍󰍠󰥩󱎵󳐧64
cell
󰓍󰐺Cell entity󲖙󱙫󰀸󲤖Cell entity󱎵mailBox
cellData
󰓍Cell entityDictionary󱰄󰒵󱊊Entity󱎵Cell󲸙
󱎵󰊡󰂟
 󰄀󲴡
Baseapp󱎵Proxy
KBEngine.Proxy󱰘󱼛KBEngine.Base
󰍠󰐺󰐺Proxy󱎵Base entity󱎵󰽧󱦬
󳍵
client
󱉙󱎵󱠠󱎵Entity󱎵󲵋󱎵MailBox
clientAddr
󱠠󰑫󱎵󱠠
bandwidthPer
Second
󰤀󱜃󲴲󱠠󱎵󳊰
 󰄀󲴡
Baseapp󱎵Entity󰋪󰨆
addTimer(initOffset
[,repeatOffset,
userData] )
createCellEntity(
[cellMailBox])
󰋪󰨆 󰄀󲴡
󰌧󳇐 offsets󱜃󰊡 󲴅󱎵ID
Entity󳖬󱃡󰋪󰨆onTimer(self, timerID, userData)
Mailbox󰀸󱎵Cellentity
󱉙BaseEntity󰌧CellCell entity
󰓍󲵃CellMailBox󲷔Base.cellData[spaceID]󲗜󱉙
delTimer( timerID )
󳎕󰀸󰌧󳇐
createInNewSpace()
󰋡󱎵spaceentity󱎵cell󲸙󰀝󰋡󱎵cell󰒖󱣒󱄷
󱉙entity󰒖󰃘󰋡󱎵space (
., 󱣒󱄷)
destroyCellEntity()
destroy()
󳎕Cell entity󱊊Base󲸙
󰓍󰍠Space󳌥󲲝󱜬󲣟CellApp󱉙‘teleport’ 󲶰󳗂󱭲󳈱󰣲Cell
entity
󰢕󰌧BaseonLoseCell󲗜󲤴Base.cellData󲗜󲩼Cell
Entity󱎵
󳈱󰣲Entity󱎵Base󲸙
Cell Entity󳖬󱰀󲗜󳈱󰣲󰂺
󲴳󱉙Entity󰭩󳎕
󲗜󱉙onLoseCell󲤴󰊡󲻽
Cell Entity󲗜Base.cellData󲴲󱴽󲣰󳌟
*
*
*
*
Cellapp󱎵Entity
id
󱎵Entity idcellbaseclient󱉙id
spaceID
Entity󱎵Space
roll
Entity󱎵󰑎
pitch
yaw
direction
Entity󱎵󳒓󱉢roll, pitch, yaw󰒖󱯵󲖙󱙫
volatileInfo
󱉙󰒖roll,pitch,yaw󱼛󱎵󰐥󰋡󳗂󱂸.def󰊸󲻽󰐺󱱫
󱐲
topSpeed
Entity󱎵󰐱󲵐󱉙󰾚󱄷󰗱󰔖
 󰄀󲴡
position
Entity󱎵󱉽󰔸󱨬󱲟
Cellapp󱎵Entity󰋪󰨆
󰐺Entity󰋪󰨆󲸮Python API󰊸󰖔󰔖:
kbengine/doc/api/kbengine_api.chm
entitiesInRange(
range
[,entityType,
position] )
setAoIRadius( radius
[, hysteresis] )
󰋪󰨆 󰄀󲴡
󰅍󱩓󰀸󲀴󱎵󰐺Entity
󰅍󱩓AOI󲀴󱎵Entity󰍠󰌑󰨆Cell󱎵Entity
󱄴󰩼󲤆
󰉪AOI󱱫󱐲󰍠500m
󳖬Ghost󲬎󱛬󱱫󱐲󰍠500m
isReal()
󲴅󰢕Entity󰍠Real󲴉󰍠Ghost󱎵
teleport(
nearbyEntityMBRef,
position,
direction )
Space󰉪Entity󱎵󱲟
󰉯EntitySpace nearbyEntityMBRef󰀸󱎵Entity󱐩󱎵
Space
destroySpace()
󳎕Space󲻽󱎵󰐺Entity,󱴽󳎕Space
destroy()
󳎕Entity󱎵Cell󲸙
Space󲻽󳎕Entity
Entity󱎵󱉐󰑐
Base󲸙󲗜
󰊡󰂟󱴶󱔲󲻽
Base entity󰧒󰐺Cell󲸙-cellData
Base entityCell󲸙󰌧󱸮󲗜󳈱󰣲
Base entity󲵋OnLoseCell()󲤴󰊡󲻽󱼛󲕽󳈱󰣲
Cell󲸙󱉢Base󲸙󰒖
Cell-only󱎵entity󱉙󱹋󰑝󰒖
Client󲸙󲵋Entity󲴌󱃚󱎵AOI󰌧󲗜
󲤖󱉙enterWorld()/leaveWorld()󲤴󰊡󱰄󰒐󱴽
󰍠 __init__()󰊡
Entity󱎵
EntityCell󱎵󱲂󱰍󰐥󰋡󰌧
󲴳󱎵Client
󰃙󲂁󱎵󰋪󰨆:
Base Entity:
KBEngine.createBaseAnywhere()
󱴶:
createBaseLocally()
createBase...FromDB()
Entity󱎵
󰃙󲂁󱎵󰋪󰨆:
Cell Entity:
createCellEntity()
createInNewSpace()
Cell entity󰊡󰂟󲤬󰉪
󱐼 Base API 󰊸󰖔: KBEngine.Base.cellData
Cell Only Entity:
createEntity()
Cell󲤴󱉙
󱸮󲗜󳉊
Entity󱎵󳈱󰣲
Cell entity󰭩󲵬󲳂󱎵󲸙󲗜󳈱󰣲
Base entityCell󲸙󲴉󱸮󲗜󳈱󰣲
󳈱󰣲Cell󲸙:
Cell: Entity.destroy()
Base: Base.destroyCellEntity()
cell󲸙󳈱󰣲󰌧Base.onLoseCell()󲗜󲤴󱉙
󳈱󰣲base󲸙:
Base.destroy()
󰓍󰍠󰥩󰊡󰂟writeToDB()󲗜󲤴󱉙
󳉊
Cell󱎵󲗜Base
Base󱎵󲗜BaseApp
󰥩󰊡󰂟
󰖔: 󰀲󱰞󲲟󰩲󲤴󰖔
󳉊vs.󰶯󳏯
󰶯󳏯 = 󰌧󰐾󲴌󱜼󲩖
󱡝󱠑
Cell󱸮󳏷
Entity󱎵cell󲸙󱎵󱸮󳏷
Entity󱎵Cell󲸙󰐺󲣩󱞫󳌥󰐺󱎵󱸮󱉙
Navigate/MoveTo*󱽛󱨬󱰐
Proximity󲜗(󳎨󳍢)
󲴊󱸮󲸮󰍠󱉙Controller󱃡󱎵
Entity󱎵Controller
󱃡󲷔󳐱󲚲󱿢󲩪tick󱄷󱎵󱸮
󱰄󰒐󰌧󲤴Python󱹋󰑝
󱉙󱃡󰑳󱎵󲵬󲳂
󰉹󱂸󱉙C/C++󱃡(󱐩script)
Entity󲬙󲪻Cell󲳪󱉽󰌧Controller󲬐󱑱󰋡
󱎵Cell
󰤀Entity󰐺󰌑󳎁Controller
󰤀󲴅Controller ID
󳎕:Entity.cancel( id )
󱸮󱎵Entity󱎵󱹋󰑝󰳱󰩬󲤴󰊡
Entity󱎵󱽛󱨬󱰐(Navigation)
󱽛󱨬󱰐󰄁󲣩󱉙Entity󱎵󱜬󲬠󱎵
󰊡
Navigation Controller󱉙RecastNavigation󳒊
󱎵󱗡󰇏󰎠󲻽󳖵󱉐󱎵NavMesh󰒖󲬠
Entity󱎵󱽛󱨬󱰐(󰋪󰨆)
󱐥󰃖󱎵󱐥󱯰󲴁
moveToPoint()
moveToEntity()
󱽛(󱉙NavMesh)
navigate()
󲵋󱎵
canNavigateTo()
getStopPoint()
Entity Proximity
ProximityController󱃡󰌑󳎁󳠉󱎵
󲲥󲕽󱎵󱟼󰋪󰔢󱎵󳎨󳍢
󲤖󳎨󳍢󱎵󲵋󱔖󰊡󲴌󲕽Y󲲥󱎵󰗱󰔖
Entity󰐺Proximity󳎨󳍢
Proximity󳎨󳍢:
Entity.addProximity()
󰃘󱎵Entity
󰀝2󲸙:
󱠠󲴲󱲟󰐥󰋡󰋡󱎵Entity:
KBEngine.controlEntity()
󰐾󰃖Entity󱎵󱲟󰐥󰋡: Entity.controlledBy
󲣯󱲟󰃘󲤖Entity󱎵󱃚󱎵Mailbox
󲴊Entity󱸮󲪶󲳸󰃘󱃚󱎵AOI󲀴 (Proxy Entity)
󰢕, 󰑝󲴳󱃚󳟂󱎵vehicle
󱴶, 󱃚󲲝󱜬󰃘󱃚 (󱴶󲸮
󲤖󰐺Proxy base󲸙)
Proxy.giveClientTo()
Entity.controlledBy 󱼛󲣯󱲟󱰊󰋡󱎵󱃚
󲗳󱎵 AOI󲗜󳈱󰣲, 󲻾Space󲗜󲻾󰋡󲲮
󱡝󱠑
KBEngine󰐾󲣯
󰐾󲹾󱲟
kbengine.xml Server󲹾󱲟󰊸
󰀸󲣩server󲴁󲕽󰌧󱎵󰊡
server󲩵󰯁󲬠
󰊥󱎵󰊸󰖔󲛲http://www.kbengine.org/docs/configuration/kbengine.html
Personality󱹋󰑝
󱃡󱎵󲤴󰊡
󱉙KBEngine Python󰃖󱄷󱨬󱰐󱯘󱎵󰪹
: , , 󳌞
󱄷󲜔(󰐾󰐾󱎵󲤴󲻽󰒵󱉽)
󱱫󱐲CellappBaseapp󱹋󰑝󰍠󱛬󱎵(cell/kbengine.py, base/kbengine.py)
Personality󱹋󰑝kbengine.xml󰊸󲻽󰀸󱱫󱐲󰍠kbengine
Personality󱹋󰑝
Cellapp Personality󱹋󰑝 onCellAppReady󰌧󲣯󰭩
󱉙import KBEngine󰒖󱉙KBEngine󰊡
KBEngine.addSpaceGeometryMapping(self.spaceID, None,
"spaces/demo")
󱴴API󰊸󰖔
Baseapp Personality󱹋󰑝 onBaseAppReady󰌧󲣯󱲟󰭩
󰓍󲚲base󱎵󲤎󲴊󰌧
󲤖󲴊󲻽󰋡󱎵space
󱹋󰑝󳖬󲸮󳖬󲕽󰬶󱄷
onBaseAppShuttingDown onCellAppShuttingDown󲗜󲤴󱉙󱎵󰌧
Baseapps󰌧󲴉󰃖󲴂󱰄󰒐󱎵󰌧󰃖󰉧onBaseAppShutDown󰪹
Personality󱹋󰑝󰕪󰂟󳐱󲚲󲕽󱎵
󰍠󱲟󰉯󰭩󱹋󰑝󱎵󰋪󲚲󰐺󲚰󲸮󰉯󲻽󳒓
󰤀󲵬󲳂󲸙󱉙󱎵󱹋󰑝󰊸
󱡝󱠑
󰐾󲤴󲤆
C++󰋞󰷪󲤴󲤆
󱸮󱎵󱉙Log󲴮󲭛󲕽󲳸󱜼
󰐾󱠠󲴌󱜼󰋞󰷪󲤨󰐾󱯵󳍵󲴌󱜼
󰾪󰢻󲤨󲣯󱲟󱨬󱰐󱃠󲼀󲪇󲴌󱜼󱉙IDE󱀝
󲴌󱜼󲤴󲤆
󰐾󱠠󲤴󲤆
󱉙GUIConsole-Debug󳖦󱸮CellappBaseapp󱎵
Python󱹋󰑝
󱉙kbengine/kbe/tools/server/pycluster/cluster_controller.py
󱸮telnet󰐾󱠠CellappBaseapp󱎵Python󱹋󰑝
󱉙KBEngine Python󰃖󰒖
Baseapp
>>> e = KBEngine.createBase( “SpawnPoint", position = (2, 3,
5) )
>>> e.id
1234
Cellapp:
>>> e = KBEngine.entities[󱎵ID]
>>> e.position
(1.000000, 2.000000, 3.000000)
󰨙y󰍠KBEngine󲻽󱎵󱠇󱐥󳠉
dir(e)
󰔖󱐼󲣩󱎵󰋪󰨆󲴉󰐺entity󲻽󱎵entity󰾪󱎵󰋪󰨆
e.destroy()
Entity base󱸮󳈱󰣲󱼛
󰐥󱴴: http://www.kbengine.org/docs/documentations/onlinedebugging.html
󱡝󱠑
Profiling󰩼󲤆
󱉙󰑫󰩼󲤆
󰝒󰀐󲼀󱎵󱃚
󰷹󲣟󲛵󰝒󱃚󰩼󲤆󲴌󲕽󰩼󲤆
󲚲󰐺󱎵󲲮
󲚲󰐺󱽛󱨬󱰐
󱞫󳌥󰐺󱎵󰭩󲚲󲼀󱶋󳏷󲀴
Bot󱹋󰑝
󰤀󱦬󱎵Entity<assets>/scripts/bot
󳒓󲸮󳐱󲚲Python󱹋󰑝
Bot󱹋󰑝󲤖󱃡Entity󱎵Client󲸙
󰍠bots󱹋󰑝󰧒󰐺󲣩Client󲻽󱉙󱎵UI3D󱎵󲸙
󱢱󱎵client󱹋󰑝󰍠󲕽󱎵
󰊡Entity󱦬󱃡󱞫󱎵class
AccountPlayer entity󳐱󲚲󱱇󱎬󱎵󱹋󰑝󰝒󰀐
󱃚󱎵󱹋󰑝
󱱇A.I.󰒖󰝒󰀐󱃚
bots
󲴁󲕽bot󲴌󱜼󲴁󱉙GUIConsole󰒖bots
󱴶
kbengine/kbe/res/server/kbengine_defs.xml
/bots 󲣯󱲟󰑫󰊡󲼀󱼛󰐱󰊡󲼀󱎵󰃘
Profiling 
GUIConsole 󱎵profile󳖦󳒓󰐺󱉙󰒖profile󲴁󲕽
󱎵󰐾󱳕󱯵󱎵󰋪󳒓󱎵󰀸󰊡(󰉠󰀲Windows)
󱉙
kbengine/kbe/tools/server/pycluster/cluster_controller.py
󲕽󱉙profile
Graphs 󰍯󱙫󰤀server󲴌󱜼󱎵󲩐󲲮
󲤨󰨙󲤖󰌚󱎵profiling󰨙󱎵󲸙󱎵󲸙
󱎵󲗜󰑳󱎵󰋪󰨆󲤴󱉙
󰌧󰃙󲂁󱉙󱀝󱎵󱲂󱰍󱖝󰒖󱉙󱐂󲛷󲴊󰕨󱖟󱎵
󰋞󰌧󱲂󱰍󳚢
󱉙profiling󱎵󰊡󰂟󰒖󳐱󲚲󱎵󲸙
Profiling
eventprofile 󲣻󰋞󰪹󱵈󰐱󱎵󰋪󰨆󲤴󱉙󰿧󰐥󰋡
networkprofile 󲣻󰋞󱉙󰐱󱎵󰪹
pyprofile 󲣻󰋞󰪹󱵈cpu󰌧󳌥󰐱󱎵python󰊡󲤴󱉙
cprofile 󲣻󰋞󰪹󱵈cpu󰌧󳌥󰐱󱎵󰇿󱎵c++󰊡󲤴󱉙
󰐥󱴴
https://github.com/kbengine/kbengine_docs
http://www.kbengine.org/docs/